﻿using mozhi.smarterp.Finance.Enums;
using System;
using System.Collections.Generic;
using Volo.Abp.Application.Dtos;

namespace mozhi.smarterp.Finance.AccountsPayables.PurchasePayables
{
    public class PurchasePayableDto : EntityDto<Guid>
    {
        public string Number { get; set; }

        public DateTime Date { get; set; }

        public DateTime DueDate { get; set; }

        public Guid SupplierId { get; set; }

        public string SupplierName { get; set; }

        public PayableDocumentType Type { get; set; }

        public RecognitionModelType RecognitionModel { get; set; }

        public decimal TotalAmountFr { get; set; }

        public decimal TotalAmount { get; set; }

        public Guid CurrencyId { get; set; }

        public string CurrencyName { get; set; }

        public decimal ExchangeRate { get; set; }

        public Guid? PurchaserDepartmentId { get; set; }

        public string PurchaserDepartmentName { get; set; }

        public Guid? PurchaserId { get; set; }

        public string PurchaserName { get; set; }

        public List<PurchasePayableItemDto> Items { get; set; }
    }

    public class PurchasePayableItemDto : EntityDto<Guid>
    {
        public Guid? ProductId { get; set; }

        public string ProductName { get; set; }

        public Guid? ExpenseItemId { get; set; }

        public string ExpenseItemName { get; set; }

        /// <summary>
        /// 计价单位
        /// </summary>
        public Guid BasicUnitId { get; private set; }

        public string BasicUnitName { get; set; }

        /// <summary>
        /// 计价数量
        /// </summary>
        public decimal BasicQuantity { get;  set; }

        public decimal Price { get;  set; }

        public decimal PriceIncludeTax { get;  set; }

        public decimal PriceExcludeTax { get;  set; }

        public Guid? TaxRateId { get;  set; }

        public string TaxRateName { get;  set; }

        public decimal? TaxRateValue { get;  set; }

        public decimal TaxAmountFr { get;  set; }

        public decimal TaxAmount { get;  set; }

        public decimal TotalAmountFr { get;  set; }

        public decimal TotalAmount { get;  set; }

        /// <summary>
        /// 是否计入采购成本
        /// </summary>
        public bool? IsRecordedCost { get;  set; }

        /// <summary>
        /// 费用承担部门
        /// </summary>
        public Guid? ExpenseBurdenDepartmentId { get;  set; }

        public string ExpenseBurdenDepartmentName {  get; set; }
    }
}
